<!--
#  Copyright 2007, Javid Jamae and Peter Johnson
# 
#  Licensed under the Apache License, Version 2.0 (the "License"); you may not
#  use this file except in compliance with the License. You may obtain a copy
#  of the License at
# 
#     http://www.apache.org/licenses/LICENSE-2.0
#  
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#  License for the specific language governing permissions and limitations
#  under the License.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>

<head>
<link rel="STYLESHEET" href="../ch00/image/jbia.css" type="text/css" />
<title>JBIA - Configuring JBoss Web Server</title>
</head>

<body>

<h1>Ch 5 - Configuring JBoss Web Server</h1>
<p>All build targets create an application server configuration named <code>
vote</code>. After the build, to run the application server, open another command
window, <code>cd</code> to the applications server's <code>bin</code> directory,
and enter:</p>
<table class="command">
  <tr>
    <td class="commandText">./run.sh -c web</td>
    <td>(Linux)</td>
  </tr>
  <tr>
    <td class="commandText">run -c web</td>
    <td>(Windows)</td>
  </tr>
</table>
<p>None of the targets creates a database.</p>

<hr />

<table class="target">
  <tr>
    <th>Target:</th>
    <td class="targetNumber">01</td>
  </tr>
  <tr>
    <th>Section:</th>
    <td>5.3.1</td>
  </tr>
  <tr>
    <th>Description:</th>
    <td>This target configures an application server configuration with virtual hosts enabled, and with a virtual host called <code>somehostname.com</code> configured. It also deploys our simple Hello World application to the server, binding it to the virtual host.</td>
  </tr>
  <tr>
    <th colspan="2">After the build:</th>
  </tr>
</table>
<p>
Before the build, you'll have to configure your DNS server to point somehostname.com to your local machine. If you don't have a DNS server, you can configure your local machine to do this. You can do this in the following file:
<ul>
<li>Windows: <code>c:\windows\system32\drivers\etc\hosts</code></li>
<li>Linux: <code>/etc/hosts</code></li>
</ul>

You'll have to add the following line to this file:<br/><br/>
<code>127.0.0.1     somehostname.com</code>
</p>

<p>
After the build, you can navigate to <a target="_new" href="http://somehostname.com:8080/hello/sayhello">http://somehostname.com:8080/hello/sayhello</a> to see the application come up on the somehostname.com host.</p>

<hr />

<table class="target">
  <tr>
    <th>Target:</th>
    <td class="targetNumber">02</td>
  </tr>
  <tr>
    <th>Section:</th>
    <td>5.3.2</td>
  </tr>
  <tr>
    <th>Description:</th>
    <td>This target builds and deploys a simple "Hello, World!" application. The application is in a WAR file called vote.war, but the default context path is set to <code>blahblahblah</code> in the WEB-INF/jboss-web.xml file.</td>
  </tr>
  <tr>
    <th colspan="2">After the build:</th>
  </tr>
</table>
<p>
Navigate to <a target="_new" href="http://localhost:8080/blahblahblah/sayhello">http://localhost:8080/blahblahblah/sayhello</a> to see the application.</p>

<hr />

<table class="target">
  <tr>
    <th>Target:</th>
    <td class="targetNumber">03</td>
  </tr>
  <tr>
    <th>Section:</th>
    <td>5.3.2</td>
  </tr>
  <tr>
    <th>Description:</th>
    <td>This target builds and deploys an interest calculator application. The application is deployed as an EAR file, but the default context path is set to <code>blahblahblah</code> in the META-INF/application.xml file.</td>
  </tr>
  <tr>
    <th colspan="2">After the build:</th>
  </tr>
</table>
<p>
Navigate to <a target="_new" href="http://localhost:8080/blahblahblah/index.faces">http://localhost:8080/blahblahblah/index.faces</a> to see the application.</p>

<hr />

<table class="target">
  <tr>
    <th>Target:</th>
    <td class="targetNumber">04</td>
  </tr>
  <tr>
    <th>Section:</th>
    <td>5.6</td>
  </tr>
  <tr>
    <th>Description:</th>
    <td>This target build and deploys a simple "Hello, World" application and enables then RequestDumperValve and the FastCommonAccessLogValve.</td>
  </tr>
  <tr>
    <th colspan="2">After the build:</th>
  </tr>
</table>
<p>Navigate to <a target="_new" href="http://localhost:8080/hello/sayhello">http://localhost:8080/hello/sayhello</a> and refresh the page multiple times. Each time you refresh the page, you should see the RequestDumperValve send some INFO-level logging messages to the console. You can also look at the <code>server\web\log\localhost_access_log.[DATE].log</code> file that the FastCommonAccessLogValve has created. The <code>[DATE]</code> part of the filename would contain today's date.</p>

<hr />

<table class="target">
  <tr>
    <th>Target:</th>
    <td class="targetNumber">05</td>
  </tr>
  <tr>
    <th>Section:</th>
    <td>5.7</td>
  </tr>
  <tr>
    <th>Description:</th>
    <td>This target builds and deploys a JSF-based interest calculator.</td>
  </tr>
  <tr>
    <th colspan="2">After the build:</th>
  </tr>
</table>
<p>Navigate to <a target="_new" href="http://localhost:8080/calculator/index.faces">http://localhost:8080/calculator/index.faces</a> to see the interest calculator.</p>
<hr />
<p align="center">&copy; 2007, Javid Jamae and Peter Johnson</p>
</body>

</html>